import api from './index'

// 领取优惠券
export const collectCoupon = (cid) => {
  return api.post(`coupon/collect/${cid}`)
}

// 获取我的优惠券（按状态）
export const getMyCoupons = (status) => {
  return api.get(`coupon/myself/by/status/${status}`)
}

// 获取分类下的优惠券
export const getCouponsByCategory = (cid) => {
  return api.get(`coupon/by/category/${cid}`)
}

// 获取我的可用优惠券（带分类信息）
export const getMyAvailableCouponsWithCategory = () => {
  return api.get('coupon/myself/available/with_category')
}

// 获取分类下前2个优惠券
export const getTop2CouponsByCategory = (cid) => {
  return api.get(`coupon/by/category/${cid}`)
}

// 获取全店优惠券
export const getWholeStoreCoupons = () => {
  return api.get('coupon/whole_store')
} 